package day06;

import java.util.Random;
import java.util.WeakHashMap;

//方法的演示
public class MethodDemo {
    public static void main(String[] args) {
/*
    say();
    sayHi("星雨");
    sayHi("123");
    sayHello("星雨",5);
    sayHello("123",80);
    double a = getNum();
        System.out.println(a);
        int m=5,n=88;
    int b = plus(m,n);
        System.out.println(b);

    int[] c = generateArray();
        System.out.println("开始输出数组 长度为" + c.length);
        for (int i = 0;i<c.length;i++){
            System.out.println("第" + (i + 1) + "的数值为:"+c[i]);
        }

        int[] d = generateArray1(20,30);
        System.out.println("开始输出数组 长度为" + d.length);
        for (int i = 0;i<d.length;i++){
            System.out.println("第" + (i + 1) + "的数值为:"+d[i]);
        }


        int[] e = generateArray1(5 , 100);
        System.out.println("开始输出数组 长度为" + e.length);
        for (int i = 0;i<e.length;i++){
            System.out.println("第" + (i + 1) + "的数值为:"+e[i]);
        }
 */





        System.out.println("执行完成");
    }











    public static void say() {
            System.out.println("Hello World");
        }
    public static void say(String name) {

    }
    public static void say(String name,int age) {
            System.out.println("Hello World");
        }
    public static void sayHi(String name){
        System.out.println("我是"+name+"今年6岁了");
    }
    public static void sayHello(String name,int num){
        System.out.println("我是"+name+"今年"+ num+"岁了");
    }
    public static double getNum(){
        return 8.88;
    }

    public static int plus(int num1,int num2){
        int num = num1 + num2;
        return num;
    }
    public static int[] generateArray(){
        Random rand = new Random();
        int[] arr = new int[10];
        for (int i= 0 ;i<arr.length;i++){
            arr[i] = rand.nextInt(100);
        }
        return arr;
    }

    public static int[] generateArray1(int a ,int b){
        Random rand = new Random();
        int[] arr = new int[a];
        for (int i= 0 ;i<arr.length;i++){
            arr[i] = rand.nextInt(b+1);
        }
        return arr;
    }


















































}




